// KCServer.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "KCServer.h"
#include "KCServerDlg.h"
#include "kc_main.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKCServerApp

BEGIN_MESSAGE_MAP(CKCServerApp, CWinApp)
	//{{AFX_MSG_MAP(CKCServerApp)
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKCServerApp construction

CKCServerApp::CKCServerApp()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CKCServerApp object

CKCServerApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CKCServerApp initialization

BOOL CKCServerApp::InitInstance()
{
	// Standard initialization
	int rc = 0;
	rc = kc_main(10000, __argv);
	if (rc)
	{
		::MessageBox(NULL, "Init KeyComment Node Server error", "Error", MB_OK|MB_ICONINFORMATION);
		return FALSE;
	}

	CKCServerDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
	}
	else if (nResponse == IDCANCEL)
	{
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
